2 // ESPurpleRequestAbstractWindowController.m
5 // Created by Evan Schoenberg on 9/22/05.
8 #import "ESPurpleRequestAbstractWindowController.h"
9 #import "adiumPurpleRequest.h"
11 @implementation ESPurpleRequestAbstractWindowController
13 - (id)initWithWindowNibName:(NSString *)windowNibName
15 if ((self = [super initWithWindowNibName:windowNibName])) {
23 * @brief This is where subclasses should generally perform actions they would normally do in windowWillClose:
25 * ESPurpleRequestAbstractWindowController calls this method only when windowWillClose: is triggered by user action
26 * as opposed to libpurple closing the window.
28 - (void)doWindowWillClose {};
30 - (void)windowWillClose:(id)sender
32 [super windowWillClose:sender];
34 if (!windowIsClosing) {
35 windowIsClosing = YES;
36 [self doWindowWillClose];
38 //Inform libpurple that the request window closed
39 [ESPurpleRequestAdapter requestCloseWithHandle:self];
44 * @brief libpurple has been made aware we closed or has informed us we should close
46 * Close our requestController's window if it's open; then release (we returned without autoreleasing initially).
48 - (void)purpleRequestClose
50 if (!windowIsClosing) {
51 windowIsClosing = YES;
52 [self closeWindow:nil];